#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<unistd.h>
#include<sys/stat.h>
#include<sys/types.h>
#include<assert.h>
#include<fcntl.h>

#define NUM 1024
#define BUFF_NONE 0x1
#define BUFF_LINE 0x2
#define BUFF_ALL 0x4

typedef struct MY_FILE
{
    int fd;              //文件描述符
    int mode;            //刷新策略
    char buffer[NUM];    //缓冲区
    int cur;             //写入字符的数量
}MY_FILE;

MY_FILE* my_fopen(const char *path, const char *mode);
size_t my_fwrite(char* str,int size,int nmemb,MY_FILE* fp);
size_t my_fread(char* ptr,int size,int nmemb,MY_FILE* fp);
void my_fclose(MY_FILE* fp);

